Handle benchmark MXR dump as successful compile#5021
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5021 +/- ##
===========================================
- Coverage 92.71% 92.71% -0.01%
===========================================
Files 596 596
Lines 31733 31736 +3
===========================================
Hits 29421 29421
- Misses 2312 2315 +3
🚀 New features to boost your workflow:
|
Regressions detected 🔴 |
|
| * @brief Throw an exception with context information | ||
| */ | ||
| #define MIGRAPHX_THROW(...) throw migraphx::make_exception(MIGRAPHX_MAKE_SOURCE_CTX(), __VA_ARGS__) | ||
| #define MIGRAPHX_THROW_BENCHMARK_MXR_DUMPED(...) \ |
There was a problem hiding this comment.
This shouldn't be added to the errors. This a gpu-specific error.
| { | ||
| m.at(cmd)(ap, {args.begin() + 1, args.end()}); | ||
| } | ||
| catch(const migraphx::benchmark_mxr_dumped& e) |
There was a problem hiding this comment.
I dont really like catching exceptions in the driver as it reduces stopping at the exception in the debugger.
This also gpu-specific and the driver is for all targets.
There was a problem hiding this comment.
Stop reading my mind. I think this would be fine though if we caught a specific execption this is trying to block out vs a catch-all here?
| if(dump_mxr and is_root) | ||
| { | ||
| MIGRAPHX_THROW( | ||
| MIGRAPHX_THROW_BENCHMARK_MXR_DUMPED( |
There was a problem hiding this comment.
Instead of throwing an exception we can just print a message with log::info and then exit(0).
| { | ||
| f(); | ||
| } | ||
| catch(const benchmark_mxr_dumped& e) |
There was a problem hiding this comment.
The pass_manager shouldn't be catching gpu-specific exceptions.
TedThemistokleous
left a comment
There was a problem hiding this comment.
Remove the catch all - either catch the specific execption in the driver you're trying to avoid or make a clear log/warning and decide if you need to exit or can move forward
| { | ||
| m.at(cmd)(ap, {args.begin() + 1, args.end()}); | ||
| } | ||
| catch(const migraphx::benchmark_mxr_dumped& e) |
There was a problem hiding this comment.
Stop reading my mind. I think this would be fine though if we caught a specific execption this is trying to block out vs a catch-all here?
|
Closing in favor of #5025 |
Motivation
Avoid error logs and nonzero driver execution for the expected
migraphx-driver compilepath that dumps benchmark MXR files viaMIGRAPHX_GPU_DUMP_BENCHMARK_MXR.Technical Details
Added a dedicated
migraphx::benchmark_mxr_dumpedexception and throw macro, used it for the benchmark MXR dump completion path, logged it as info in the pass manager, and swallowed it at driver command dispatch so the dump-only mode completes successfully.Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable